package com.slliver.service;

import com.slliver.pojo.Product;
import com.slliver.service.impl.ProductClientServcieFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@Component
@FeignClient(value = "PRODUCT-HYSTRIX-SERVICE", fallbackFactory = ProductClientServcieFallbackFactory.class)
public interface ProductClientServcie {

    @GetMapping("/feign/product/get/{productId}")
    public Product selectById(@PathVariable("productId") Long productId);
    public List<Product> selectAll();
}
